<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2018/4/28
 * Time: 13:18
 */

namespace app\api\controller;

use think\Loader;
use  \think\Session;
use \think\Request;
use think\Log;
use  app\common\logic\TaobaoLogic;

class Tb extends Base
{

    public function _initialize() {
        Loader::import('taobao\TopSdk', EXTEND_PATH);
        $c = new \TopClient;
        $c->appkey = '24798316';
        $c->secretKey = 'b60868c5ab3157899d9b0cfa05325669';
        $this->TopClient=$c;

    }

    /*
     * 单品精准搜索
     */

    public function  jzs(){

        $tb_api=new TaobaoLogic();
        $keywords=input('get.q');

        $data=array();
        $data=$tb_api->optionalFinddetail($keywords);

        $this->assign('data',$data);
        return $this->fetch();
    }

}